package com.yuan.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
public class HelloController {

    @PreAuthorize("hasAuthority('test')")
    @GetMapping("/hello")
    public String hello() {
        return "hello" + new Date();
    }
}
